import React, { useState } from 'react';
import PublicHeader from '@/components/header';
import './index.less';

export default function ProductionPage() {
    const [proData, setProData] = useState<any>();

    function togSelect(id: any) {}

    function handleEdit(id: any, num: number) {}
    return (
        <main className='container common-con-top'>
            <PublicHeader title='首页' confirm record={false} />
            <section className='pro-list-con'>
                <ul className='pro-list-ul'>
                    {proData?.dataList?.map((item: any) => {
                        return (
                            <li className='pro-item' key={item.id}>
                                <div className='pro-item-select' onClick={() => togSelect(item.id)}>
                                    <span
                                        className={`icon-xuanze1 pro-select-status ${item.selectStatus ? 'pro-selected' : ''}`}
                                    />
                                    <span className='pro-name'>{item.product_name}</span>
                                </div>
                                <div className='pro-item-edit'>
                                    <span
                                        className={`icon-jian ${item.selectNum > 0 ? 'edit-active' : ''}`}
                                        onClick={() => handleEdit(item.id, -1)}
                                    />
                                    <span className='pro-num'>{item.selectNum}</span>
                                    <span className='icon-jia' onClick={() => handleEdit(item.id, 1)} />
                                </div>
                            </li>
                        );
                    })}
                </ul>
            </section>
        </main>
    );
}
